<?php

namespace app\api\controller;

use addons\epay\library\Service;
use app\admin\model\goods\Order;
use app\common\controller\Api;
use app\common\controller\Payment;
use think\Controller;
use think\Db;
use think\Request;


class Studylists extends Api
{
    private static $model;
    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';


    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        self::$model = new \app\common\model\StudyLists();
    }

    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function lists()
    {
        $where = [
            'status' => 1
        ];

        $keyword = input('keyword');
        if ($keyword) {
            $where['name'] = ['like', '%' . $keyword . '%'];
        }

        $cateId = input('cate_id');
        if ($cateId) {
            $where['cate_id'] = $cateId;
        }

        $list = self::$model->where($where)->order('weigh desc')->paginate();
        $this->success('教学视频列表', $list);
    }
}
